<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
   
   <meta name="description" content="string operations">
    
    <meta name="author" content="John S. Urban" >
    <link rel="icon" href="../favicon.png">

    <title>expand &ndash; M_strings</title>

    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/pygments.css" rel="stylesheet">
    <link href="../css/font-awesome.min.css" rel="stylesheet">
    <link href="../css/local.css" rel="stylesheet">
    
    <link  href="../tipuesearch/tipuesearch.css" rel="stylesheet">
    
    

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    
    <script src="../js/jquery-2.1.3.min.js"></script>
    <script src="../js/svg-pan-zoom.min.js"></script>

  </head>

  <body>

    <!-- Fixed navbar -->
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="../index.html">M_strings </a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
        
            <li class="dropdown hidden-xs visible-sm visible-md hidden-lg">
              <a href="#" class="dropdown-toggle"
              data-toggle="dropdown" role="button"
              aria-haspopup="true"
     aria-expanded="false">Contents <span class="caret"></span></a>
        <ul class="dropdown-menu">
          
              
            <li><a href="../lists/files.html">Source Files</a></li>
        
        
        
            <li><a href="../lists/modules.html">Modules</a></li>
        
            
                                
            <li><a href="../lists/procedures.html">Procedures</a></li>
        
               
            <li><a href="../lists/types.html">Derived Types</a></li>
        
        
            </ul>
            </li>


<li class="visible-xs hidden-sm visible-lg"><a href="../lists/files.html">Source Files</a></li>



<li class="visible-xs hidden-sm visible-lg"><a href="../lists/modules.html">Modules</a></li>



<li class="visible-xs hidden-sm visible-lg"><a href="../lists/procedures.html">Procedures</a></li>

                             
<li class="visible-xs hidden-sm visible-lg"><a href="../lists/types.html">Derived Types</a></li>


          </ul>
        
        <form action="../search.html" class="navbar-form navbar-right" role="search">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="Search" name="q" id="tipue_search_input" autocomplete="off" required>
        </div>
<!--
        <button type="submit" class="btn btn-default">Submit</button>
-->
        </form>
        
        </div><!--/.nav-collapse -->
      </div>
    </nav>

    <div class="container">
    
  
  <div class="row">
    <h1>expand
      <small>Function</small>
    
    </h1>
    
<div class="row">
  <div class="col-lg-12">
<div class="well well-sm">
  <ul class="list-inline" style="margin-bottom:0px;display:inline">
     
     
     
     
    
    
     <li><i class="fa fa-list-ol"></i>
       <a data-toggle="tooltip"
    data-placement="bottom" data-html="true"
    title=" 2.9% of total for procedures.">72 statements</a>
     </li> 
     
     
     
    <li><i class="fa fa-code"></i><a href="../src/M_strings.f90"> Source File</a></li>
     
     
  </ul>
  <ol class="breadcrumb in-well text-right">
  
    
     <li><a href='../sourcefile/m_strings.f90.html'>M_strings.f90</a></li>
    
     <li><a href='../module/m_strings.html'>M_strings</a></li>
    
  
     <li class="active">expand</li>
  </ol>
</div>
</div>
</div>
<script>
  $(function () {
  $('[data-toggle="tooltip"]').tooltip()
  })
</script>

  </div>
  
  <div class="row">
    <div class="col-md-3 hidden-xs hidden-sm visible-md visible-lg">
    
<div id="sidebar">
  
<h3>Contents</h3>
 



<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title"><a data-toggle="collapse" href="#vars-0">Variables</a></h3></div>
  <div id="vars-0" class="panel-collapse collapse">
    <div class="list-group">
      
      <a class="list-group-item" href="../proc/expand.html#variable-c_horizontal_tab">c_horizontal_tab</a>
      
      <a class="list-group-item" href="../proc/expand.html#variable-esc">esc</a>
      
      <a class="list-group-item" href="../proc/expand.html#variable-i~6">i</a>
      
      <a class="list-group-item" href="../proc/expand.html#variable-ios">ios</a>
      
      <a class="list-group-item" href="../proc/expand.html#variable-lgth~2">lgth</a>
      
      <a class="list-group-item" href="../proc/expand.html#variable-thr">thr</a>
      
      <a class="list-group-item" href="../proc/expand.html#variable-xxx">xxx</a>
      
    </div>
  </div>
</div>




















<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title">Source Code</h3></div>
  <div class="list-group">
    <a class="list-group-item" href="../proc/expand.html#src">expand</a>
  </div>
</div>



</div>

    </div>
    
    <div class="col-md-9" id='text'>
    <h2>
public function expand(line, escape) result(lineout)
    
    
   
</h2>
    
  


    
    <h2 id="name">NAME</h2>
<div class="codehilite"><pre><span></span><code>expand(3f) - [M_strings:NONALPHA] expand C-like escape sequences
(LICENSE:PD)
</code></pre></div>

<h2 id="synopsis">SYNOPSIS</h2>
<p>function expand(line,escape) result(lineout)</p>
<div class="codehilite"><pre><span></span><code>character(len=*)                      :: line
character(len=1),intent(in),optional  :: escape
character(len=:),allocatable          :: lineout
</code></pre></div>

<h2 id="description">DESCRIPTION</h2>
<div class="codehilite"><pre><span></span><code> <span class="nv">EXPAND</span><span class="ss">()</span> <span class="nv">expands</span> <span class="nv">sequences</span> <span class="nv">used</span> <span class="nv">to</span> <span class="nv">represent</span> <span class="nv">commonly</span> <span class="nv">used</span> <span class="nv">escape</span>
 <span class="nv">sequences</span> <span class="nv">or</span> <span class="nv">control</span> <span class="nv">characters</span>. <span class="nv">By</span> <span class="nv">default</span> ...

 <span class="nv">Escape</span> <span class="nv">sequences</span>
   \      <span class="nv">backslash</span>
   <span class="nv">a</span>      <span class="nv">alert</span> <span class="ss">(</span><span class="nv">BEL</span><span class="ss">)</span> <span class="o">--</span> <span class="nv">g</span> <span class="nv">is</span> <span class="nv">an</span> <span class="nv">alias</span> <span class="k">for</span> <span class="nv">a</span>
   <span class="nv">b</span>      <span class="nv">backspace</span>
   <span class="nv">c</span>      <span class="nv">suppress</span> <span class="nv">further</span> <span class="nv">output</span>
   <span class="nv">e</span>      <span class="nv">escape</span>
   <span class="nv">f</span>      <span class="nv">form</span> <span class="nv">feed</span>
   <span class="nv">n</span>      <span class="nv">new</span> <span class="nv">line</span>
   <span class="nv">r</span>      <span class="nv">carriage</span> <span class="k">return</span>
   <span class="nv">t</span>      <span class="nv">horizontal</span> <span class="nv">tab</span>
   <span class="nv">v</span>      <span class="nv">vertical</span> <span class="nv">tab</span>
   <span class="nv">oNNN</span>   <span class="nv">byte</span> <span class="nv">with</span> <span class="nv">octal</span> <span class="nv">value</span> <span class="nv">NNN</span> <span class="ss">(</span><span class="mi">3</span> <span class="nv">digits</span><span class="ss">)</span>
   <span class="nv">dNNN</span>   <span class="nv">byte</span> <span class="nv">with</span> <span class="nv">decimal</span> <span class="nv">value</span> <span class="nv">NNN</span> <span class="ss">(</span><span class="mi">3</span> <span class="nv">digits</span><span class="ss">)</span>
   <span class="nv">xHH</span>    <span class="nv">byte</span> <span class="nv">with</span> <span class="nv">hexadecimal</span> <span class="nv">value</span> <span class="nv">HH</span> <span class="ss">(</span><span class="mi">2</span> <span class="nv">digits</span><span class="ss">)</span> <span class="o">--</span> <span class="nv">h</span> <span class="nv">is</span> <span class="nv">an</span> <span class="nv">alias</span> <span class="k">for</span> <span class="nv">x</span>

 <span class="nv">The</span> <span class="nv">default</span> <span class="nv">escape</span> <span class="nv">character</span> <span class="nv">is</span> <span class="nv">the</span> <span class="nv">backslash</span>, <span class="nv">but</span> <span class="nv">this</span> <span class="nv">may</span> <span class="nv">be</span>
 <span class="nv">changed</span> <span class="nv">using</span> <span class="nv">the</span> <span class="nv">optional</span> <span class="nv">parameter</span> <span class="nv">ESCAPE</span>.
</code></pre></div>

<h2 id="examples">EXAMPLES</h2>
<div class="codehilite"><pre><span></span><code><span class="nv">Sample</span> <span class="nv">Program</span>:

 <span class="nv">program</span> <span class="nv">demo_expand</span>
 <span class="o">!</span>  <span class="nv">test</span> <span class="nv">filter</span> <span class="nv">to</span> <span class="nv">expand</span> <span class="nv">escape</span> <span class="nv">sequences</span> <span class="nv">in</span> <span class="nv">input</span> <span class="nv">lines</span>
 <span class="nv">use</span> <span class="nv">M_strings</span>, <span class="nv">only</span> : <span class="nv">expand</span>
 <span class="nv">character</span><span class="ss">(</span><span class="nv">len</span><span class="o">=</span><span class="mi">1024</span><span class="ss">)</span> :: <span class="nv">line</span>
 <span class="nv">integer</span>             :: <span class="nv">ios</span>
    <span class="nv">READFILE</span>: <span class="nv">block</span>
       <span class="k">do</span>
          <span class="nv">read</span><span class="ss">(</span><span class="o">*</span>,<span class="s1">&#39;</span><span class="s">(A)</span><span class="s1">&#39;</span>,<span class="nv">iostat</span><span class="o">=</span><span class="nv">ios</span><span class="ss">)</span><span class="nv">line</span>
          <span class="k">if</span><span class="ss">(</span><span class="nv">ios</span> <span class="o">/=</span> <span class="mi">0</span><span class="ss">)</span> <span class="k">exit</span> <span class="nv">READFILE</span>
          <span class="nv">write</span><span class="ss">(</span><span class="o">*</span>,<span class="s1">&#39;</span><span class="s">(a)</span><span class="s1">&#39;</span><span class="ss">)</span><span class="nv">trim</span><span class="ss">(</span><span class="nv">expand</span><span class="ss">(</span><span class="nv">line</span><span class="ss">))</span>
       <span class="nv">enddo</span>
    <span class="nv">endblock</span> <span class="nv">READFILE</span>
 <span class="k">end</span> <span class="nv">program</span> <span class="nv">demo_expand</span>

<span class="nv">Sample</span> <span class="nv">input</span>:

  \<span class="nv">e</span>[<span class="mi">2</span><span class="nv">J</span>
  \<span class="nv">tABC</span>\<span class="nv">tabc</span>
  \<span class="nv">tA</span>\<span class="nv">a</span>
  \<span class="nv">nONE</span>\<span class="nv">nTWO</span>\<span class="nv">nTHREE</span>
</code></pre></div>

<h2 id="author">AUTHOR</h2>
<div class="codehilite"><pre><span></span><code>John S. Urban
</code></pre></div>

<h2 id="license">LICENSE</h2>
<div class="codehilite"><pre><span></span><code>Public Domain
</code></pre></div>
    

    <h3>Arguments</h3>
    
      
<table class="table table-striped varlist">
<thead><tr><th>Type</th>
<th>Intent</th><th>Optional</th>
<th>Attributes</th><th></th><th>Name</th><th></th></thead>



<tbody>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-line~2"></span>character(len=*),</td>
  <td>intent(in)</td>
  <td></td>
  
  <td></td><td>::</td>
  <td><strong>line</strong></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-escape"></span>character(len=1),</td>
  <td>intent(in),</td>
  <td>optional</td>
  
  <td></td><td>::</td>
  <td><strong>escape</strong></td><td></td>
  
</tr>

</tbody>
</table>

    
    
    
    
    
    
    
   <h3>Return Value <small><span class="anchor" id="variable-lineout"></span>character(len=:),
  allocatable</small></h3>
    
    
    
    
     
    <br>

    <section class="visible-xs visible-sm hidden-md">
      
<h3>Contents</h3>
 



<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title"><a data-toggle="collapse" href="#vars-1">Variables</a></h3></div>
  <div id="vars-1" class="panel-collapse collapse">
    <div class="list-group">
      
      <a class="list-group-item" href="../proc/expand.html#variable-c_horizontal_tab">c_horizontal_tab</a>
      
      <a class="list-group-item" href="../proc/expand.html#variable-esc">esc</a>
      
      <a class="list-group-item" href="../proc/expand.html#variable-i~6">i</a>
      
      <a class="list-group-item" href="../proc/expand.html#variable-ios">ios</a>
      
      <a class="list-group-item" href="../proc/expand.html#variable-lgth~2">lgth</a>
      
      <a class="list-group-item" href="../proc/expand.html#variable-thr">thr</a>
      
      <a class="list-group-item" href="../proc/expand.html#variable-xxx">xxx</a>
      
    </div>
  </div>
</div>




















<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title">Source Code</h3></div>
  <div class="list-group">
    <a class="list-group-item" href="../proc/expand.html#src">expand</a>
  </div>
</div>



    </section>
    <br class="visible-xs visible-sm hidden-md">

    

    
    <section>    
      <h2>Variables</h2>
    
<table class="table table-striped varlist">
<thead><tr><th>Type</th><th>Visibility</th>

<th>Attributes</th><th></th><th>Name</th><th></th><th>Initial</th><th></th></thead>



<tbody>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-c_horizontal_tab"></span>character(len=*),</td>
  
  <td>public,</td>
  <td>parameter</td><td>::</td>
  <td><strong>c_horizontal_tab</strong></td><td> =</td><td>char(9)</td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-esc"></span>character(len=1),</td>
  
  <td>public</td>
  <td></td><td>::</td>
  <td><strong>esc</strong></td><td></td><td></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-i~6"></span>integer,</td>
  
  <td>public</td>
  <td></td><td>::</td>
  <td><strong>i</strong></td><td></td><td></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-ios"></span>integer,</td>
  
  <td>public</td>
  <td></td><td>::</td>
  <td><strong>ios</strong></td><td></td><td></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-lgth~2"></span>integer,</td>
  
  <td>public</td>
  <td></td><td>::</td>
  <td><strong>lgth</strong></td><td></td><td></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-thr"></span>character(len=3),</td>
  
  <td>public</td>
  <td></td><td>::</td>
  <td><strong>thr</strong></td><td></td><td></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-xxx"></span>integer,</td>
  
  <td>public</td>
  <td></td><td>::</td>
  <td><strong>xxx</strong></td><td></td><td></td><td></td>
  
</tr>

</tbody>
</table>

    </section>
    <br>
    
    
    
    
    

    
    
    
    
    


    
    
    
    <section>
    <h2><span class="anchor" id="src"></span>Source Code</h2>
    <div class="highlight"><pre><span></span><span class="k">function </span><span class="n">expand</span><span class="p">(</span><span class="n">line</span><span class="p">,</span><span class="n">escape</span><span class="p">)</span> <span class="k">result</span><span class="p">(</span><span class="n">lineout</span><span class="p">)</span>
<span class="c">!x!USE ISO_C_BINDING ,ONLY: c_horizontal_tab</span>
<span class="k">implicit none</span>

<span class="c">! ident_30=&quot;@(#)M_strings::expand(3f): return string with escape sequences expanded&quot;</span>

<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">),</span><span class="k">parameter</span>            <span class="kd">::</span> <span class="nb">c_horizontal_tab</span><span class="o">=</span><span class="nb">char</span><span class="p">(</span><span class="mi">9</span><span class="p">)</span>
<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>           <span class="kd">::</span> <span class="n">line</span>
<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="mi">1</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">),</span><span class="k">optional</span>  <span class="kd">::</span> <span class="n">escape</span> <span class="c">! escape character. Default is backslash</span>
<span class="c">! expand escape sequences found in input string</span>
<span class="c">! Escape sequences</span>
<span class="c">!    %%      escape character           %a     alert (BEL) -- gi is an alias for a</span>
<span class="c">!    %b      backspace                  %c     suppress further output</span>
<span class="c">!    %e      escape                     %E     escape</span>
<span class="c">!    %f      form feed                  %n     new line</span>
<span class="c">!    %r      carriage return            %t     horizontal tab</span>
<span class="c">!    %v      vertical tab</span>
<span class="c">!    %oNNN   byte with octal value NNN (3 digits)</span>
<span class="c">!    %dNNN   byte with decimal value NNN (3 digits)</span>
<span class="c">!    %xHH    byte with hexadecimal value HH (2 digits) -- h is an alias for x</span>
<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>                      <span class="kd">::</span> <span class="n">esc</span>    <span class="c">! escape character. Default is %</span>
<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="p">:),</span><span class="k">allocatable</span>          <span class="kd">::</span> <span class="n">lineout</span>
<span class="kt">integer</span>                               <span class="kd">::</span> <span class="n">i</span>
<span class="kt">integer</span>                               <span class="kd">::</span> <span class="n">lgth</span>
<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>                      <span class="kd">::</span> <span class="n">thr</span>
<span class="kt">integer</span>                               <span class="kd">::</span> <span class="n">xxx</span>
<span class="kt">integer</span>                               <span class="kd">::</span> <span class="n">ios</span>
   <span class="n">i</span><span class="o">=</span><span class="mi">0</span> <span class="c">! pointer into input</span>

   <span class="n">lgth</span><span class="o">=</span><span class="nb">len_trim</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
   <span class="n">lineout</span><span class="o">=</span><span class="s1">&#39;&#39;</span>

   <span class="k">if</span><span class="p">(</span><span class="n">lgth</span><span class="p">.</span><span class="n">eq</span><span class="p">.</span><span class="mi">0</span><span class="p">)</span><span class="k">return</span>

<span class="k">   if</span> <span class="p">(</span><span class="nb">present</span><span class="p">(</span><span class="n">escape</span><span class="p">))</span><span class="k">then</span>
<span class="k">      </span><span class="n">esc</span><span class="o">=</span><span class="n">escape</span>
   <span class="k">else</span>
<span class="k">      </span><span class="n">esc</span><span class="o">=</span><span class="nb">char</span><span class="p">(</span><span class="mi">92</span><span class="p">)</span>
   <span class="k">endif</span>

<span class="k">   </span><span class="nb">EXP</span><span class="p">:</span> <span class="k">do</span>
<span class="k">      </span><span class="n">i</span><span class="o">=</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span>
      <span class="k">if</span><span class="p">(</span><span class="n">i</span><span class="p">.</span><span class="n">gt</span><span class="p">.</span><span class="n">lgth</span><span class="p">)</span><span class="k">exit</span>
<span class="k">      if</span><span class="p">(</span><span class="n">line</span><span class="p">(</span><span class="n">i</span><span class="p">:</span><span class="n">i</span><span class="p">).</span><span class="n">eq</span><span class="p">.</span><span class="n">esc</span><span class="p">)</span><span class="k">then</span>
<span class="k">         </span><span class="n">i</span><span class="o">=</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span>
         <span class="k">if</span><span class="p">(</span><span class="n">i</span><span class="p">.</span><span class="n">gt</span><span class="p">.</span><span class="n">lgth</span><span class="p">)</span><span class="k">exit</span>
<span class="k">         if</span><span class="p">(</span><span class="n">line</span><span class="p">(</span><span class="n">i</span><span class="p">:</span><span class="n">i</span><span class="p">).</span><span class="n">ne</span><span class="p">.</span><span class="n">esc</span><span class="p">)</span><span class="k">then</span>
<span class="k">            </span><span class="n">BACKSLASH</span><span class="p">:</span> <span class="k">select case</span><span class="p">(</span><span class="n">line</span><span class="p">(</span><span class="n">i</span><span class="p">:</span><span class="n">i</span><span class="p">))</span>
            <span class="k">case</span><span class="p">(</span><span class="s1">&#39;a&#39;</span><span class="p">,</span><span class="s1">&#39;A&#39;</span><span class="p">,</span><span class="s1">&#39;g&#39;</span><span class="p">,</span><span class="s1">&#39;G&#39;</span><span class="p">);</span><span class="n">lineout</span><span class="o">=</span><span class="n">lineout</span><span class="o">//</span><span class="nb">char</span><span class="p">(</span>  <span class="mi">7</span><span class="p">)</span> <span class="c">! %a     alert (BEL)</span>
            <span class="k">case</span><span class="p">(</span><span class="s1">&#39;b&#39;</span><span class="p">,</span><span class="s1">&#39;B&#39;</span><span class="p">);</span><span class="n">lineout</span><span class="o">=</span><span class="n">lineout</span><span class="o">//</span><span class="nb">char</span><span class="p">(</span>  <span class="mi">8</span><span class="p">)</span>         <span class="c">! %b     backspace</span>
            <span class="k">case</span><span class="p">(</span><span class="s1">&#39;c&#39;</span><span class="p">,</span><span class="s1">&#39;C&#39;</span><span class="p">);</span><span class="k">exit </span><span class="nb">EXP</span>                           <span class="c">! %c     suppress further output</span>
            <span class="k">case</span><span class="p">(</span><span class="s1">&#39;d&#39;</span><span class="p">,</span><span class="s1">&#39;D&#39;</span><span class="p">)</span>                                    <span class="c">! %d     Dnnn decimal value</span>
                      <span class="n">thr</span><span class="o">=</span><span class="n">line</span><span class="p">(</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">:)</span>
                   <span class="k">read</span><span class="p">(</span><span class="n">thr</span><span class="p">,</span><span class="s1">&#39;(i3)&#39;</span><span class="p">,</span><span class="n">iostat</span><span class="o">=</span><span class="n">ios</span><span class="p">)</span><span class="n">xxx</span>
                      <span class="n">lineout</span><span class="o">=</span><span class="n">lineout</span><span class="o">//</span><span class="nb">char</span><span class="p">(</span><span class="n">xxx</span><span class="p">)</span>
                   <span class="n">i</span><span class="o">=</span><span class="n">i</span><span class="o">+</span><span class="mi">3</span>
            <span class="k">case</span><span class="p">(</span><span class="s1">&#39;e&#39;</span><span class="p">,</span><span class="s1">&#39;E&#39;</span><span class="p">);</span><span class="n">lineout</span><span class="o">=</span><span class="n">lineout</span><span class="o">//</span><span class="nb">char</span><span class="p">(</span> <span class="mi">27</span><span class="p">)</span>         <span class="c">! %e     escape</span>
            <span class="k">case</span><span class="p">(</span><span class="s1">&#39;f&#39;</span><span class="p">,</span><span class="s1">&#39;F&#39;</span><span class="p">);</span><span class="n">lineout</span><span class="o">=</span><span class="n">lineout</span><span class="o">//</span><span class="nb">char</span><span class="p">(</span> <span class="mi">12</span><span class="p">)</span>         <span class="c">! %f     form feed</span>
            <span class="k">case</span><span class="p">(</span><span class="s1">&#39;n&#39;</span><span class="p">,</span><span class="s1">&#39;N&#39;</span><span class="p">);</span><span class="n">lineout</span><span class="o">=</span><span class="n">lineout</span><span class="o">//</span><span class="nb">char</span><span class="p">(</span> <span class="mi">10</span><span class="p">)</span>         <span class="c">! %n     new line</span>
           <span class="c">!case(&#39;n&#39;,&#39;N&#39;);lineout=lineout//new_line(&#39;A&#39;)     ! %n     new line</span>
            <span class="k">case</span><span class="p">(</span><span class="s1">&#39;o&#39;</span><span class="p">,</span><span class="s1">&#39;O&#39;</span><span class="p">)</span>
                      <span class="n">thr</span><span class="o">=</span><span class="n">line</span><span class="p">(</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">:)</span>
                   <span class="k">read</span><span class="p">(</span><span class="n">thr</span><span class="p">,</span><span class="s1">&#39;(o3)&#39;</span><span class="p">,</span><span class="n">iostat</span><span class="o">=</span><span class="n">ios</span><span class="p">)</span><span class="n">xxx</span>
                      <span class="n">lineout</span><span class="o">=</span><span class="n">lineout</span><span class="o">//</span><span class="nb">char</span><span class="p">(</span><span class="n">xxx</span><span class="p">)</span>
                   <span class="n">i</span><span class="o">=</span><span class="n">i</span><span class="o">+</span><span class="mi">3</span>
            <span class="k">case</span><span class="p">(</span><span class="s1">&#39;r&#39;</span><span class="p">,</span><span class="s1">&#39;R&#39;</span><span class="p">);</span><span class="n">lineout</span><span class="o">=</span><span class="n">lineout</span><span class="o">//</span><span class="nb">char</span><span class="p">(</span> <span class="mi">13</span><span class="p">)</span>         <span class="c">! %r     carriage return</span>
            <span class="k">case</span><span class="p">(</span><span class="s1">&#39;t&#39;</span><span class="p">,</span><span class="s1">&#39;T&#39;</span><span class="p">);</span><span class="n">lineout</span><span class="o">=</span><span class="n">lineout</span><span class="o">//</span><span class="nb">c_horizontal_tab</span>  <span class="c">! %t     horizontal tab</span>
            <span class="k">case</span><span class="p">(</span><span class="s1">&#39;v&#39;</span><span class="p">,</span><span class="s1">&#39;V&#39;</span><span class="p">);</span><span class="n">lineout</span><span class="o">=</span><span class="n">lineout</span><span class="o">//</span><span class="nb">char</span><span class="p">(</span> <span class="mi">11</span><span class="p">)</span>         <span class="c">! %v     vertical tab</span>
            <span class="k">case</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">,</span><span class="s1">&#39;X&#39;</span><span class="p">,</span><span class="s1">&#39;h&#39;</span><span class="p">,</span><span class="s1">&#39;H&#39;</span><span class="p">)</span>                            <span class="c">! %x     xHH  byte with hexadecimal value HH (1 to 2 digits)</span>
                      <span class="n">thr</span><span class="o">=</span><span class="n">line</span><span class="p">(</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">:)</span>
                   <span class="k">read</span><span class="p">(</span><span class="n">thr</span><span class="p">,</span><span class="s1">&#39;(z2)&#39;</span><span class="p">,</span><span class="n">iostat</span><span class="o">=</span><span class="n">ios</span><span class="p">)</span><span class="n">xxx</span>
                      <span class="n">lineout</span><span class="o">=</span><span class="n">lineout</span><span class="o">//</span><span class="nb">char</span><span class="p">(</span><span class="n">xxx</span><span class="p">)</span>
                   <span class="n">i</span><span class="o">=</span><span class="n">i</span><span class="o">+</span><span class="mi">2</span>
            <span class="k">end select </span><span class="n">BACKSLASH</span>
         <span class="k">else</span>
<span class="k">            </span><span class="n">lineout</span><span class="o">=</span><span class="n">lineout</span><span class="o">//</span><span class="n">esc</span>                             <span class="c">! escape character, defaults to backslash</span>
         <span class="k">endif</span>
<span class="k">      else</span>
<span class="k">         </span><span class="n">lineout</span><span class="o">=</span><span class="n">lineout</span><span class="o">//</span><span class="n">line</span><span class="p">(</span><span class="n">i</span><span class="p">:</span><span class="n">i</span><span class="p">)</span>
      <span class="k">endif</span>
<span class="k">      if</span><span class="p">(</span><span class="n">i</span><span class="p">.</span><span class="n">ge</span><span class="p">.</span><span class="n">lgth</span><span class="p">)</span><span class="k">exit </span><span class="nb">EXP</span>
<span class="nb">   </span><span class="k">enddo </span><span class="nb">EXP</span>

<span class="k">end function </span><span class="n">expand</span>
</pre></div>

    </section>
    <br>
    
    
    </div>
  </div>


    <hr>    
    </div> <!-- /container -->
    <footer>
      <div class="container">
      <div class="row">
        <div class="col-xs-6 col-md-4"><p>&copy; 2022 
                                          </p></div>
        <div class="col-xs-6 col-md-4 col-md-push-4">
          <p class="text-right">
            Documentation generated by 
            <a href="https://github.com/cmacmackin/ford">FORD</a>
             on 2022-01-16 22:32  
          </p>
        </div>
        <div class="col-xs-12 col-md-4 col-md-pull-4"><p class="text-center"> M_strings was developed by John S. Urban</p></div>
      </div>
      <br>
      </div> <!-- /container -->    
    </footer>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
<!--
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
-->
    <script src="../js/bootstrap.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="../js/ie10-viewport-bug-workaround.js"></script>

    <!-- MathJax JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        TeX: { extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: { autoNumber: 'AMS' } },
        jax: ['input/TeX','input/MathML','output/HTML-CSS'],
        extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']
      });
    </script>
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    
    
    <script src="../tipuesearch/tipuesearch_content.js"></script>
    <script src="../tipuesearch/tipuesearch_set.js"></script>
    <script src="../tipuesearch/tipuesearch.js"></script>
    
    
  </body>
</html>